package edu.xlh.travel.enumeration;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public enum OrderStatusEnum {
    paying("0", "待支付"),
    delivery("1" , "待消费"),
    endTrade("2", "交易关闭"),
    drawbackApllying("3", "退款申请中"),
    drawbackApllyingFail("4", "商家拒绝退款"),
    drawbackApllyingSuccess("5", "退款成功，交易关闭"),
    cancelApllying("6", "订单取消申请中"),
    cancelApllyingSuccess("7", "订单取消成功，交易关闭"),
    hotelConsuming("8", "酒店退房成功"),
    scenicConsumingSuccess("9", "景点消费成功，交易关闭"),
    staying("10", "入住中"),
    arrangeing("11", "安排中"),
    hotelConsumeApplyinig("12", "酒店退房申请中"),
    hotelConsumeApplyinigFail("13", "商家拒绝退房"),
    reletNoPay("14", "续订未支付")
    ;
    private static final Set<String> enumSet = new HashSet<>(50);

    static {
        Arrays.asList(SFTPOperateTypeEnum.values()).forEach(e -> enumSet.add(e.getCode()));
    }

    public static boolean hasEnum(String code) {
        return enumSet.contains(code);
    }

    //code
    private String code;

    //描述
    private String desc;

    OrderStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }
    public String getDesc() {
        return desc;
    }
}
